<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../css/zhuce.css">
    <style>
        .zh_mima {
            width: 1200px;
            height: 530px;
            background: #ffffff;
            margin: 0 auto;
            margin-top: 16px;
            overflow: hidden;
        }

        .zh_mima_title {
            width: 1200px;
            font-size: 14px;
            background: #fbfbfb;
            height: 40px;
            line-height: 40px;
            padding-left: 30px;
            color: #666666;
        }

        .zh_div {
            margin-top: 40px;
        }

        .zh_div h1,
        .zh_success h1 {
            font-size: 30px;
            text-align: center;
            font-weight: bold;
        }

        .zc_Box {
            width: 800px;
            padding-top: 20px;
            margin: 0 auto;
            overflow: hidden;
        }

        .zc_Box ul li label {
            color: #666666;
            font-size: 14px;
            float: left;
            display: inline;
            text-align: right;
            line-height: 38px;
            width: 100px;
        }

        .zc_Box ul li .input {
            width: 320px;
            padding-left: 5px;
            height: 36px;
            line-height: 36px;
            border: 1px solid #cccccc;
            float: left;
            display: inline;
            margin-left: 10px;
            font-size: 14px;
        }

        .zc_Box .zc_submit {
            padding: 30px 0 0 100px;
        }

        .qita_login {
            font-size: 14px;
            color: #999999;
            margin: 40px 0 0 80px;
        }

        .yzm {
            width: 130px;
            height: 38px;
            color: #fff;
            background: #ff6931;
            margin-left: 10px;
            cursor: pointer;
            border: 1px solid #ff6931;
            float: left;
            display: inline;
            font-size: 14px;
            text-align: center;
        }

        #mobile_verify {
            width: 180px;
            padding-left: 5px;
            height: 36px;
            line-height: 36px;
            border: 1px solid #cccccc;
            float: left;
            display: inline;
            margin-left: 10px;
            font-size: 14px;
        }

        .tncode {
            border: 1px solid #ccc;
            border-radius: 2px;
            width: 134px;
            height: 40px;
            cursor: pointer;
            opacity: 1;
            line-height: 40px;
            text-align: center;
            margin-left: 110px;
        }

        .zc_Box ul li label.title {
            width: 100px;
        }

        .zc_Box input[type="submit"] {
            font-size: 16px;
            font-weight: 600;
            color: #FFF;
            background-color: #ff6931;
            width: 147px;
            height: 40px;
            margin-left: 10px;
            border: solid 1px #ff9168;
            border-radius: 3px;
            cursor: pointer;
        }

        .zc_Box .zc_submit {
            padding: 30px 0 0 100px;
        }

        .zc_Box ul li label {
            color: #666666;
            font-size: 14px;
            float: left;
            display: inline;
            text-align: right;
            line-height: 38px;
            width: 100px;
        }

        input[type="hidden"i] {
            display: none;
            appearance: initial;
            background-color: initial;
            cursor: default;
            padding: initial;
            border: initial;
        }

        .zc_Box ul li {
            height: 34px;
            line-height: 34px;
            margin-top: 20px;
        }
    </style>
</head>

<body>
    <div class="topbg">
        <div class="topNav">
            <div class="topNava fl">
                <a href="/index.php">猪易购</a>欢迎您|中国畜牧行业唯一在线视频直播交易商城！
                [<a href="../index.html">首页</a>] [<a
                    href="login.html">登录</a>]
                [<a style="color:#ff6931"
                    href="zhuce.html">注册</a>]
            </div>
            <div class="topNavb fr">
                <dd>
                    <div class="quicka"><a target="_blank" href="index.php?m=member">我的猪易购<i></i></a></div>
                    <ul>
                        <li><a href="index.php?m=member">我是买家</a></li>
                        <li><a href="index.php?m=shop&c=manage">我是卖家</a></li>
                    </ul>
                </dd>
                <dd>
                    <div class="quicka"><a target="_blank" href="index.php?m=order&c=manage&a=cart">购物车(<strong
                                class="forg">0</strong>)<i class="emlist"></i></a></div>
                    <ul class="quickcar">
                        <div class="carbtn"><a href="index.php?m=order&c=manage&a=cart">查看购物车</a></div>
                    </ul>
                </dd>
                <!--<dd>
                    <a target="_blank" href="#" id="message">消息(<strong>0</strong>)<i></i></a>
                </dd>-->
                <dd>
                    <div class="quicka"><a
                            href="#">客服中心<i></i></a>
                    </div>
                </dd>
                <dd>
                    <a target="_blank" href="#">收藏夹</a>
                </dd>
                <!--<dd>
                    <a target="_blank" href="product.php">网站导航</a>
                </dd>-->
            </div>
        </div>
    </div>

    <div class="zh_mima">
        <div class="zh_mima_title">您的位置：首页 > 账号注册</div>
        <div class="zh_div">
            <h1>账号注册</h1>
            <form method="post" action="index.php?m=member&c=index&a=register" id="form">
                <div class="zc_Box">
                    <input name="dosubmit" type="hidden" id="dosubmit" value="register" />
                    <input name="forward" type="hidden" id="forward" value="http://www.zhuego.com/goods-6344.html" />
                    <input name="connect_id" type="hidden" id="forward" value="" />
                    <input type="hidden" name="siteid" value="1" />
                    <input type="hidden" name="mobile" id="mobile" value="" />
                    <input type="hidden" name="password" id="password" value="" />
                    <!-- <p class="zx_tishi">
                    注册有礼：</br>
                    1. 新用户注册赠送20元新人券,可在【我的】-【优惠券】中查看；</br>
                    2. 首次使用“快捷登录”方式也视为新注册用户
                </p>-->
                    <ul>
                        <li>
                            <label class="title">您的手机号码:</label>
                            <input name="username" id="username" placeholder="请输入您的手机号" class="input" />
                        </li>
                        <!--<li>
                    <label class="title">新密码:</label>
                    <input placeholder="请输入新的密码" class="input" name="password" id="password" type="password" />
                    </li>
                    <li>
                    <label class="title">确认密码:</label>
                    <input placeholder="请重复输入新的密码" class="input" name="re_password" type="password" id="re_password" />
                    </li>-->
                        <!--<li>-->
                        <!--<label class="title">验证码:</label>-->
                        <!--<input placeholder="请输入验证码" class="input" name="code" id="code"/>-->
                        <!--<img id='code_img' onclick='this.src=this.src+"&"+Math.random()' src='http://www.zhuego.com/api.php?op=checkcode&code_len=4&font_size=14&width=120&height=26&font_color=&background='>-->
                        <!--<a href="#" id="replace" style="float:left;padding-right: 30px;line-height: 44px;">换一张</a>-->
                        <!--</li>-->
                        
                        <li>
                            <label class="title">短信验证码:</label>
                            <input placeholder="请输入您收到的短信验证码" class="iphone" name="mobile_verify" id="mobile_verify" />
                            <input onclick="get_verify()" id="GetVerify" type="button" class="yzm" value="点击获取" />
                        </li>
                        <div class="zc_submit"><input class="btnSubmit" type="submit" id="btnRegister" value="点击注册" />
                            <!--<a href="javascript:;">猪易购用户注册协议</a>-->
                        </div>
                    </ul>
                </div>
            </form>
        </div>
    </div>
    <script src="../js/ajax.js"></script>
    <script src="../js/jquery-1.9.1.min.js"></script>
    <script>
        $('#replace').click(function () {
            $('#code_img').click();
        });

        $(function () {
            $('#form').validate({
                //验证后ajax提交
                submitHandler: function (form) {
                    //alert(123);
                    var mobile = $('#username').val();
                    $('#mobile').val(mobile);
                    $(form).ajaxSubmit(function (data) {
                        var rtnObj = eval("(" + data + ")");
                        if (rtnObj.ac == 'ok') {
                            alert(rtnObj.msg);
                            var navURL = $("#forward").val();
                            if (navURL == '') {
                                navURL = 'index.php';
                            }
                            window.location.href = navURL;
                        } else {
                            alert(rtnObj.msg);
                        }
                    });
                },
                errorPlacement: function (error, element) {
                    //element.next().next('.i-name').append(error);
                    error.appendTo(element.parent());
                },
                rules: {
                    /*txyzm:{
                        required:true,
                        remote  : {
                            url :'ajax_back_end.php',
                            type:'post',
                            data:{
                                txyzm : function(){
                                    return $('#txyzm').val();
                                },
                            }
                        }
                    },
                    */
                    username: {
                        required: true,
                        minlength: 6,
                        //isMobile : true,
                        remote: {
                            url: 'index.php?m=member&c=index&a=public_checkname_ajax',
                            type: 'get',
                            data: {
                                //action:'ajax',
                                //branch:'check_mobile',
                                username: function () {
                                    return $('#username').val();
                                },
                            }
                        }
                    },
                    mobile_verify: {
                        required: true,
                        remote: {
                            url: 'api.php',
                            type: 'get',
                            data: {
                                op: 'sms_idcheck',
                                action: 'id_code',
                                mobile: function () {
                                    return $('#mobile').val();
                                },
                                mobile_verify: function () {
                                    $("#password").val($('#mobile_verify').val());
                                    return $('#mobile_verify').val();
                                },
                            }
                        }
                    },

                    /*password:{
                        required:true,
                        minlength: 6,
                    },
                    re_password:{
                        required:true,
                        minlength: 6,
                        equalTo: "#password",
                    },*/
                },
                messages: {
                    /*txyzm:{
                        required:'图形验证码不能为空',
                        remote:'图形验证码错误',
                    },*/
                    username: {
                        required: '请填写用户名',
                        minlength: "确认手机不能小于11个字符",
                        //isMobile : "请正确填写您的手机号码",
                        remote: '手机号已被注册，请更换！',
                    },
                    mobile_verify: {
                        required: '短信验证码不能为空',
                        remote: '短信验证码错误',
                    },
                    /*password:{
                        required:'请输入密码',
                        minlength: jQuery.format("密码不能小于{0}个字符")
                    },
                    re_password:{
                        required: "请输入确认密码",
                        minlength: "确认密码不能小于6个字符",
                        equalTo: "两次输入密码不一致不一致",
                    },*/
                }
            });
        });
    </script>
</body>

</html>